package com.smartcommunity.entity.house;

import com.smartcommunity.bean.enumeration.HouseTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel(value="房屋返回实体")
public class HouseListHouseResp {
    @ApiModelProperty(value="主键ID,房屋ID",name="id")
    private Integer id;

    @ApiModelProperty(value="小区编码,多小区以逗号分隔",name="villageCode",example = "123456")
    private String villageCode;

    @ApiModelProperty(value="楼栋编号",name="buildingNo",example = "28")
    private String buildingNo;

    @ApiModelProperty(value="单元号",name="unitNo",example = "28")
    private String unitNo;

    @ApiModelProperty(value="楼层",name="floor",example = "10")
    private String floor;

    @ApiModelProperty(value="房屋编号，单元编号示例：2单元101，编码为：2-101",name="houseNo",example = "101")
    private String houseNo;
    @ApiModelProperty(value="房屋名称",name="houseName",example = "101")
    private String houseName;

    @ApiModelProperty(value="房屋类型 0: 其他,1:自住房,2:出租房，3:闲置房，4.民宿，" +
            " 5.寄宿，6.借宿，7.单位宿舍，8.临时性宿舍，9.农民工公寓",name="type")
    private Integer type;

    @ApiModelProperty(value="类型描述",name="typeDesc")
    private String typeDesc;

    @ApiModelProperty(value="记录新增或更新时的时间",name="rowTime",hidden = true)
    private Date rowTime;

    @ApiModelProperty(value="录入库时间",name="mrowTime",hidden = true)
    private Date mrowTime;

    @ApiModelProperty(value="房屋实有人口数量",name="realPeopleCounts",hidden = true)
    private Long realPeopleCounts;

    public void setTypeDesc(){
        if(this.type==null){
            this.typeDesc=null;
        }else {
            this.typeDesc = HouseTypeEnum.getNamebyValue(this.type);
        }
    }
}
